//
//  AppErrorSheet.swift
//  SwiftUIFly
//
//  Created by shen on 2023/10/18.
//

import SwiftUI

struct AppErrorSheet: View {
    @Binding var message: String?

    var body: some View {
        ContentUnavailableView {
            Label {
                Text("Application Error")
            } icon: {
                Image(systemName: "xmark.octagon")
            }
        } description: {
            VStack {
                Text("A critical error occurred. Restart to try again.")

                if let message = message {
                    Text(message)
                }
            }
        }
        .padding()
    }
}
